from tkinter.ttk import Label


class Students:
    def __init__(self,student_id,name,age,gender,tall,weight,score,address,tel):
        self.student_id=student_id
        self.name=name
        self.age=age
        self.gender=gender
        self.tall=tall
        self.weight=weight
        self.score=score
        self.address=address
        self.tel=tel
    def show(self):
        print("学号：{}，姓名：{}，年龄：{}，性别：{}，身高：{}，体重：{}，成绩：{}，地址：{}，电话：{}".format(self.student_id,self.name,self.age,self.gender,self.tall,self.weight,self.score,self.address,self.tel))
    def Learn(self,learn_time):
        print("学习时间%s"%(learn_time))
    def playGames(self,gameName):
        print("游戏名：{}".format(gameName))
    def editCode(self,row_num):
        print("编程代码行数：{}".format(row_num))
    def sum_num(self,num1,num2):
         print("{}+{}={}".format(num1,num2,num1+num2))
         return num1+num2
def StudentInfo():
    try:
        student_id=input("学生ID：")
        name=input("姓名:")
        age=int(input("年龄："))
        gender =input("性别：")
        tall= int(input("身高："))
        weight = int(input("体重KG:"))
        score =int(input("分数："))
        address =input("地址:")
        tel=int(input("电话："))
        learn_time=int(input("学习时间(分钟):"))
        game_name=input("游戏名：")
        row=int(input("编程代码行数："))
        num1=int(input("数1:"))
        num2=int(input("数2:"))
    except:
        print("输入格式不正确!")
    else:
        student = Students(student_id,name,age,gender,tall,weight,score,address,tel)
        student.show()
        student.Learn(learn_time)
        student.playGames(game_name)
        student.editCode(row)
        student.sum_num(num1,num2)



class Car:
    def __init__(self,car_type,num,color,weight,capacity):
        self.car_type=car_type
        self.num=num
        self.color=color
        self.weight=weight
        self.capacity=capacity
    def car_run(self,function):
        print("{}功能为{}".format(self.car_type,function))

def carInfo():
    try:
        car_type=input("车型：")
        num = int(input("车轮数："))
        color= input("颜色：")
        weight=int(input("重量（KG）："))
        capacity=int(input("油箱大小(L)："))
        function=input("具体功能：")
    except:
        print("输入格式不正确!")
    else:
        car1=Car(car_type,num,color,weight,capacity)
        car1.car_run(function)
car1 = Car("法拉利",4,"红色",2000,30)
car2 = Car("宝马",4,"黑色",2000,30)
car3 = Car("铃木",4,"红色",2000,30)
car4 = Car("五菱",4,"红色",2000,30)
car5 = Car("拖拉机",4,"红色",2000,30)


class laptop:
    def __init__(self,laptop_type,time,color,weight,cpu,nc,yp):
        self.laptop=laptop_type
        self.time=time
        self.color=color
        self.weight=weight
        self.cpu=cpu
        self.nc=nc
        self.yp=yp
    def playGame(self,gameName):
        print("游戏名：{}".format(gameName))
    def Work(self):
        print("办公")
laptop1=laptop("联想",4,"灰色",2,"Amd",16,512)
laptop1.Work()
laptop1.playGame("五子棋")


class monkey:
    def __init__(self,monkey_type,sex,color,weight):
        self.monkey_type=monkey_type
        self.sex=sex
        self.color=color
        self.weight=weight
    def create_fire(self,material):
        print("造火材料为：{}".format(material))
    def learn(self,detail_list):
        print("学习的事物：{}".format(detail_list))









